package com.example.bigevent.config;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.IOException;
public class ReadTest {

    public static void main(String[] args) {
        String filePath = "D:\\testencoding\\gb.txt";

        try (InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(filePath), "UTF-8");
             BufferedReader reader = new BufferedReader(inputStreamReader)) {
            String line;
            while ((line = reader.readLine()) != null) {
                System.out.println(line);
            }
            System.out.println("文件读取完成！");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
